Skip to content

fix(eap): Map transaction alias to segment name#114908

Draft
buenaflor wants to merge 10 commits intomasterfrom
buenaflor/fix/eap-transaction-segment-name
Draft

fix(eap): Map transaction alias to segment name#114908
buenaflor wants to merge 10 commits intomasterfrom
buenaflor/fix/eap-transaction-segment-name

Conversation

@buenaflor
Copy link
Copy Markdown
Contributor

@buenaflor buenaflor commented May 5, 2026

The public span transaction attribute now resolves to sentry.segment.name instead of the deprecated sentry.transaction field. EAP coalesces the deprecated transaction alias into the canonical segment name attribute, so this keeps transaction searches aligned with the stored convention attribute.

The branch is intentionally scoped to the EAP attribute alias mapping after splitting the process-segments consumer fix into a separate PR.

Map the transaction alias to the canonical segment name attribute so EAP search uses the coalesced replacement for the deprecated sentry.transaction alias.

Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 5, 2026
buenaflor and others added 2 commits May 5, 2026 22:47
Keep the trace attributes endpoint displaying the public transaction alias
when EAP returns the deprecated sentry.transaction attribute name.

Co-Authored-By: GPT-5.5 <noreply@cursor.sh>
Co-authored-by: Cursor <cursoragent@cursor.com>
buenaflor and others added 5 commits May 6, 2026 17:20
Use sentry.segment.name before legacy v1 fields when propagating the
segment name so processing preserves the canonical EAP value.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep replacement span attributes visible when serializing trace item attributes
and add coverage for segment name propagation fallback behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Document that segment name propagation falls back to the span name after
checking canonical and legacy description fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore the existing trace item attribute filtering behavior for replacement
attributes while keeping the segment name propagation changes separate.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop endpoint serialization tests that no longer apply after restoring the
existing replacement attribute filtering behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@buenaflor buenaflor marked this pull request as ready for review May 6, 2026 15:59
Copilot AI review requested due to automatic review settings May 6, 2026 15:59
@buenaflor buenaflor requested review from a team as code owners May 6, 2026 15:59
@buenaflor buenaflor changed the title fix(eap): Use segment name for transaction attribute fix(eap): Use segment name for transaction attribute and fix segment name propagation May 6, 2026
@buenaflor buenaflor marked this pull request as draft May 6, 2026 16:01
Remove process-segments consumer changes from this branch so the EAP alias
update can be reviewed independently.

Co-authored-by: Cursor <cursoragent@cursor.com>
@buenaflor buenaflor changed the title fix(eap): Use segment name for transaction attribute and fix segment name propagation fix(eap): Use segment name for transaction attribute May 6, 2026
@buenaflor buenaflor changed the title fix(eap): Use segment name for transaction attribute fix(eap): Map transaction alias to segment name May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Backend Test Failures

Failures on 6c25384 in this run:

tests/snuba/api/endpoints/test_organization_trace_item_attributes.py::OrganizationTraceItemAttributesEndpointSpansTest::test_attribute_collisionlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/snuba/api/endpoints/test_organization_trace_item_attributes.py:912: in test_attribute_collision
    assert sorted(
E   AssertionError: assert [{'attributeS...ration'}, ...] == [{'attributeS...pan.op'}, ...]
E     
E     At index 2 diff: {'key': 'sentry.transaction', 'name': 'sentry.transaction', 'attributeSource': {'source_type': 'sentry'}, 'attributeType': 'string'} != {'key': 'span.description', 'name': 'span.description', 'attributeType': 'string', 'attributeSource': {'source_type': 'sentry'}, 'secondaryAliases': ['description', 'message']}
E     
E     Full diff:
E       [
E           {
E               'attributeSource': {
E                   'source_type': 'sentry',
E               },
E               'attributeType': 'string',
E               'key': 'device.class',
E               'name': 'device.class',
E           },
E           {
E               'attributeSource': {
E                   'source_type': 'sentry',
E               },
E               'attributeType': 'string',
E               'key': 'project',
E               'name': 'project',
E     +     },
E     +     {
E     +         'attributeSource': {
E     +             'source_type': 'sentry',
E     +         },
E     +         'attributeType': 'string',
E     +         'key': 'sentry.transaction',
E     +         'name': 'sentry.transaction',
E           },
E           {
E               'attributeSource': {
E                   'source_type': 'sentry',
E               },
E               'attributeType': 'string',
E               'key': 'span.description',
E               'name': 'span.description',
E               'secondaryAliases': [
E                   'description',
E                   'message',
E               ],
E           },
E           {
E               'attributeSource': {
E                   'source_type': 'sentry',
E               },
E               'attributeType': 'string',
... (28 more lines)
tests/snuba/api/endpoints/test_organization_trace_item_attributes.py::OrganizationTraceItemAttributesEndpointSpansTest::test_paginationlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/snuba/api/endpoints/test_organization_trace_item_attributes.py:734: in test_pagination
    assert sorted(
E   AssertionError: assert [{'attributeS...iption', ...}] == [{'attributeS...transaction'}]
E     
E     At index 0 diff: {'key': 'sentry.transaction', 'name': 'sentry.transaction', 'attributeSource': {'source_type': 'sentry'}, 'attributeType': 'string'} != {'key': 'span.description', 'name': 'span.description', 'attributeType': 'string', 'attributeSource': {'source_type': 'sentry'}, 'secondaryAliases': ['description', 'message']}
E     
E     Full diff:
E       [
E     +     {
E     +         'attributeSource': {
E     +             'source_type': 'sentry',
E     +         },
E     +         'attributeType': 'string',
E     +         'key': 'sentry.transaction',
E     +         'name': 'sentry.transaction',
E     +     },
E           {
E               'attributeSource': {
E                   'source_type': 'sentry',
E               },
E               'attributeType': 'string',
E               'key': 'span.description',
E               'name': 'span.description',
E               'secondaryAliases': [
E                   'description',
E                   'message',
E               ],
E           },
E     -     {
E     -         'attributeSource': {
E     -             'source_type': 'sentry',
E     -         },
E     -         'attributeType': 'string',
E     -         'key': 'transaction',
E     -         'name': 'transaction',
E     -     },
E       ]
tests/snuba/api/endpoints/test_organization_trace_item_attributes.py::OrganizationTraceItemAttributesEndpointSpansTest::test_tags_list_strlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/snuba/api/endpoints/test_organization_trace_item_attributes.py:502: in test_tags_list_str
    assert sorted(
E   AssertionError: assert [{'attributeS...action'}, ...] == [{'attributeS...n', ...}, ...]
E     
E     At index 5 diff: {'key': 'sentry.transaction', 'name': 'sentry.transaction', 'attributeSource': {'source_type': 'sentry'}, 'attributeType': 'string'} != {'key': 'span.description', 'name': 'span.description', 'attributeType': 'string', 'attributeSource': {'source_type': 'sentry'}, 'secondaryAliases': ['description', 'message']}
E     
E     Full diff:
E       [
E           {
E               'attributeSource': {
E                   'source_type': 'user',
E               },
E               'attributeType': 'string',
E               'key': 'bar',
E               'name': 'bar',
E           },
E           {
E               'attributeSource': {
E                   'source_type': 'user',
E               },
E               'attributeType': 'string',
E               'key': 'baz',
E               'name': 'baz',
E           },
E           {
E               'attributeSource': {
E                   'source_type': 'sentry',
E               },
E               'attributeType': 'string',
E               'key': 'device.class',
E               'name': 'device.class',
E           },
E           {
E               'attributeSource': {
E                   'source_type': 'user',
E               },
E               'attributeType': 'string',
E               'key': 'foo',
E               'name': 'foo',
E           },
E           {
E               'attributeSource': {
E                   'source_type': 'sentry',
E               },
E               'attributeType': 'string',
E               'key': 'project',
E               'name': 'project',
E           },
E           {
... (36 more lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant